import json

# Create your models here.
class UIResult:
    def __init__(self,success=False,message='',remark=''):#登录成功或否，错误原因，成功后返回的数据
        self.success=success
        self.message=message
        self.remark=remark
    def __str__(self):
        return json.dumps(self,default=UIResult.objTodic)#将UIResult对象转换为json数据
    @staticmethod
    def objTodic(obj):
        dic={}
        dic.update(obj.__dict__)
        return dic
class User:
    def __init__(self,uid,selfslogo,selfphoto,aboutme):
        self.uid=uid
        self.selfslogo=selfslogo
        self.selfphoto=selfphoto
        self.aboutme=aboutme
class Recarticles:
    def __init__(self,id,aobj,posid,weight):
        self.id = id
        self.aobj = aobj
        self.posid = posid
        self.weight = weight
